#pragma once
//TODO: remove this
#include <iostream>
// TODO: ask METAREGEL IF we can define __061008926_02666448_SENET_HEURISTIC_

class HeuristicParams
{
public:
	int static const numSubHeuristics = 7;
	int static const numPlayers = 2;

	static HeuristicParams getGeneticAlgHeuristicParams()
	{
		HeuristicParams h;
		h.setGeneticAlgResultCoef();
		return h;
	}

	void setSimpleCoefficients()
	{
		//TODO: remove this
		std::cout << "setSimpleCoefficeients()!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
		
		
		m_CoefficientsSum = 0.0f;
		for (int i = 0; i < numSubHeuristics; ++i)
		{
			for (int j = 0; j < numPlayers; ++j)
			{
				m_Coefficients[i][j] = 1.0f;
				m_CoefficientsSum += m_Coefficients[i][j];
			}
		}
// 		m_Coefficients[0][0] = 20.0f;
// 		m_Coefficients[0][1] = 20.0f;
// 		m_CoefficientsSum += 38.0f;
	}

	void setCoefficients(const float coefficients[numSubHeuristics][numPlayers])
	{
		m_CoefficientsSum = 0.0f;
		for (int i = 0; i < numSubHeuristics; ++i)
		{
			for (int j = 0; j < numPlayers; ++j)
			{
				m_Coefficients[i][j] = coefficients[i][j];
				m_CoefficientsSum += m_Coefficients[i][j];
			}
		}

		//TODO: remove this
		std::cout << "Heuristics params: ";
		for(int k=0; k< numSubHeuristics; k++)
		{
			std::cout << m_Coefficients[k][0] << " ";
		}
		std::cout << std::endl;
	}

	void setGeneticAlgResultCoef()
	{
		setGeneticAlgResultCoefAux(0, 18.0f);
		setGeneticAlgResultCoefAux(1, 15.0f);
		setGeneticAlgResultCoefAux(2, 12.0f);
		setGeneticAlgResultCoefAux(3, 5.0f);
		setGeneticAlgResultCoefAux(4, 6.0f);
		setGeneticAlgResultCoefAux(5, 8.0f);
		setGeneticAlgResultCoefAux(6, 10.0f);

		m_CoefficientsSum = 0.0f;
		for (int i = 0; i < numSubHeuristics; ++i)
		{
			for (int j = 0; j < numPlayers; ++j)
			{
				m_CoefficientsSum += m_Coefficients[i][j];
			}
		}
	}

	void setGeneticAlgResultCoefAux(int heuristicIndex, float val)
	{
		for (int i = 0; i < 2; ++i)
		{
			m_Coefficients[heuristicIndex][i] = val;
		}
	}

	//////////////////////////////////////////////////////////////////////////
	// This is a two dim array of coefficients of the form:
	// numSubHeuristics x numPlayers
	//////////////////////////////////////////////////////////////////////////
	float m_Coefficients[numSubHeuristics][numPlayers];
	float m_CoefficientsSum;
};
